1. Field of the Disclosure
This disclosure relates generally to computer systems; and more particularly, it is directed to the simulation of brushes for deposition of paint or ink onto a virtual canvas using computer systems, and the determination of the results of such simulations using a per-bristle opacity value calculated from a target brush stroke opacity value.
2. Description of the Related Art
Digital image editing is the process of creating and/or modifying digital images using a computer system. Using specialized software programs, users may manipulate and transform images in a variety of ways. These digital image editors may include programs of differing complexity, such as limited-purpose programs associated with acquisition devices (e.g., digital cameras and scanners with bundled or built-in programs for managing brightness and contrast); limited editors suitable for relatively simple operations such as rotating and cropping images; and professional-grade programs with large and complex feature sets.
Digital images may include raster graphics, vector graphics, or a combination thereof. Raster graphics data (also referred to herein as bitmaps) may be stored and manipulated as a grid of individual picture elements called pixels. A bitmap may be characterized by its width and height in pixels and also by the number of bits per pixel. Commonly, a color bitmap defined in the RGB (red, green blue) color space may comprise between one and eight bits per pixel for each of the red, green, and blue channels. Another commonly used representation is a CMYK color space. In these and other color space representations, an alpha channel may be used to store additional data such as per-pixel transparency values (or the inverse-opacity values). For example, per-pixel data representing paint on a brush tool or on a canvas may include a set of color values (e.g., one per channel) and an opacity value for the paint.
An operation often provided by a digital image editor is the use of a virtual “paintbrush” (also referred to herein as a “brush” or a “brush tool”) to modify a digital image by depositing virtual paint or virtual ink. Various prior approaches have attempted to model a real-world brush and its behavior in the context of such an operation. For example, a two-dimensional (2D) raster image may be created to represent the shape of the brush as it contacts the canvas, and the 2D image may be stamped repeatedly along the input path. In another approach, a vector representation of the brush tip has been used instead of a 2D raster image. In some systems, a brush tip is represented as a single triangle mesh.
Some existing digital painting applications create strokes by repeatedly applying a stamp at incremental positions along a path. The stamp consists of a 2D array of pixels that represent what the “brush” looks like at an instant in time. By repeatedly applying the stamp at close spacing, the effect of the brush being dragged continuously across the canvas is created, in the form of an elongated stroke. Some existing applications provide two settings for users to control the appearance of the stroke: flow and opacity, where the flow value represents the stamp transparency, and the opacity value represents the transparency of the entire stroke. However, a problem with this approach is that the results when setting the flow to a given value can be unpredictable, and can vary with other aspects of the stroke, such as with the spacing of the stamps. For example, when stamps having a particular flow value are spaced close together, the opacity of the overall brush stroke may be much higher than when stamps having the same flow value are spaced farther apart.